package com.sanzang.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sanzang.vo.JsonResult;

/**
 * 模拟控制器出错
 * @author sanzang
 *
 */

@Controller
@RequestMapping("/ex")
public class ExceptionController {
	
	@RequestMapping("/test1")
	public String test1() {
		System.out.println("出错了");
		int n= 9/0;
		return "user/test";
	}
	
	@RequestMapping("/test2")
	@ResponseBody
	public JsonResult test2() {
		JsonResult ret = new JsonResult(true, "查询成功");
		System.out.println("出错了");
		int n= 9/0;
		return ret;
	} 

}
